# -*- coding: utf-8 -*-
conn=None
cursor=None
databaselogging=None
socketlogging=None
SPLITCHAR='`'
ENDCHAR='\x0a'
TABCHAR='\t'
COMMANDID_LENGTH=4
COMMANDTYPE_LENGTH=4
DEVICEID_LENGTH=6
DATETIME_LENGTH=14
TASKID_LENGTH=20
COMMAND_LOGIN='1000'
COMMAND_DOWNLOAD_RECEIVE_BILL='1001'
COMMAND_NEW_RECEVIE_BILL='1002'
COMMAND_UPDATE_SIGNIN_BILL='1003'
COMMAND_NEW_PROBLEM_BILL = '1004'
COMMAND_QUERY_XML='1006'
COMMAND_UPLOAD_RECEVIE_BILL='1007'

STATUS_OK='00'
STATUS_ERROR_UNKOWN='FF'
STATUS_ERROR_TIMEOUT='FE'
STATUS_ERROR_SOCKET='FD'
STATUS_ERROR_LOGIN_PASSWORD_DISMATCH='FC'
STATUS_ERROR_LOGIN_NO_USER='FB' 
STATUS_ERROR_NO_BILLNO='E0'
STATUS_VERSION_ERROR = 'VE'
CONTENT_SPLIT='\t'     
SEND_END_CHAR='\n'

VERSION  = "ZTO-01.01"

TAB_PROBLEM_COLUMN = "TYPE,BILL_CODE,SEND_SITE,REGISTER_SITE,REGISTER_DATE,REGISTER_MAN ,PROBLEM_CAUSE,REVERSION,REVERSION_MAN,REVERSION_DATE,PROVIDE_SITE ,REGISTER_SAVE_DATE,REGISTER_MAN_DEPARTMENT "

TAB_GPRS_SIGN_QY_COLUMN = "BILL_CODE, SIGN_MAN, RECORD_SITE, RECORD_MAN, RECORD_MAN_CODE, SIGN_DATE, REMARK"
 
TAB_GPRS_SCAN_QY_COLUMN = "   ID           , BILL_CODE            , SUB_BILL_CODE        , TRANSFERE_BILL_CODE  , OWNER_BAG_NO, \
                SCAN_TYPE    , PRE_OR_NEXT_STATION  , SCAN_MAN             , SCAN_SITE            , SCAN_DATE,\
        DISPATCH_OR_SEND_MAN , CUSTOMER_NAME        , GOODS_TYPE           , CLASS                , REMARK,\
         INSERT_COMPUTER_ID  , SCAN_MAN_CODE        , LOGIN_USER           , LOGIN_USER_CODE      , LOGIN_USER_NAME,\
        GOODS_WEIGHT         , GOODS_FEE            , SIGNIN_NAME          , BL_RETURN_WRITE_ID   , CUSTOMER_PHONE1,\
         CUSTOMER_PHONE2, BL_MESSAGE,INSERT_COMPUTER_ID,DESTINATION_CODE"

TAB_GPRS_MSG_COLUMN = "GUID, SUBJECT, OWNER_SITE, EMPLOYEE_CODE, EMPLOYEE_NAME, MSG_STATE, CREATE_DATE, MSG_CONTENT, ATTEMPER_MAN, BILL_CODE, RESTORE, RESTORE_DATE"

         
